<!-- src/views/UserLogin.vue -->
<template>
  <div class="login-bg">
    <div class="login-container">
      <div class="login-header">
        <img :src="require('@/assets/zjjxh.png')" class="login-logo" alt="logo" />
        <h2 class="login-title">校园招生小程序后台登录</h2>
      </div>
      <el-form ref="loginForm" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="用户名" prop="username">
          <el-input v-model="form.username" placeholder="请输入用户名"></el-input>
        </el-form-item>
        <el-form-item label="密码" prop="password">
          <el-input type="password" v-model="form.password" placeholder="请输入密码"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" class="login-btn" @click="handleLogin">登录</el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      form: { username: '', password: '' },
      rules: {
        username: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
        password: [{ required: true, message: '请输入密码', trigger: 'blur' }]
      }
    }
  },
  methods: {
    handleLogin() {
      this.$router.push('/dashboard')
    }
  }
}
</script>

<style scoped>
.login-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-container {
  background: #fff;
  max-width: 400px;
  width: 100%;
  margin: 60px auto;
  padding: 40px 32px 32px 32px;
  border-radius: 18px;
  box-shadow: 0 8px 32px 0 rgba(60, 110, 84, 0.12);
  position: relative;
}
.login-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
}
.login-logo {
  width: 100px;
  height: 100px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: #e0f7fa;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(60, 110, 84, 0.10);
}
.login-title {
  color: #3c6e54;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 0;
  letter-spacing: 2px;
  text-align: center;
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(60,110,84,0.08);
}
.el-form {
  margin-top: 12px;
}
.el-form-item__label {
  color: #3c6e54;
  font-weight: 500;
}
.login-btn {
  width: 100%;
  background: linear-gradient(90deg, #3c6e54 0%, #4fd1c5 100%);
  border: none;
  font-size: 18px;
  font-weight: 600;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(60, 110, 84, 0.08);
}
.login-btn:hover {
  background: linear-gradient(90deg, #4fd1c5 0%, #3c6e54 100%);
}
</style>